home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / totsrc11.zip / TOTFAST.PAS < prev    next >
Pascal/Delphi Source File  |  1993-05-04  |  59KB  |  2,185 lines

  1. {               Copyright 1991 TechnoJock Software, Inc.               }
  2. {                          All Rights Reserved                         }
  3. {                         Restricted by License                        }
  4.  
  5. {                             Build # 1.10                             }
  6.  
  7. Unit totFAST;
  8. {$I TOTFLAGS.INC}
  9.  
  10. {
  11.  Development History:
  12.              Mar 15 91  1.00a   Changed DesqView checks
  13.              May  3 91  1.00b   Read Char checks
  14.              May  3 91  1.00c   Changed virtual write and writeln
  15.              Jun  2 91  1.00d   Corrected WriteOBJ CRT calls
  16.              Jul 10 91  1.00e   Corrected WriteCenter method, and CursOff
  17.              Nov 06 91  1.00f   Real correction of WriteCenter
  18.              Feb 05 92  1.00g   Corrected cursor restores after saves
  19. }
  20.  
  21. INTERFACE
  22.  
  23. uses DOS, CRT, totSYS, totLOOK, totINPUT;
  24.  
  25. TYPE
  26.  
  27. StrScreen = string[255];   {alter as necessary}
  28. StrVisible = string[80];   {alter as necessary}
  29. tDirection = (Up, Down, Left, Right, Vert, Horiz);
  30. tCoords = record
  31.    X1,Y1,X2,Y2:shortint;
  32. end;
  33. tByteCoords = record
  34.    X1,Y1,X2,Y2:byte;
  35. end;
  36. ShadowPosition = (UpLeft,UpRight,DownLeft,DownRight);
  37.  
  38. WritePtr = ^WriteOBJ;
  39. pWriteOBJ = ^WriteOBJ;
  40. WriteOBJ = object
  41.    vWidth: byte;           {how wide is screen}
  42.    vScreenPtr: pointer;    {memory location of screen data}
  43.    vWindow: tByteCoords;   {active screen area}
  44.    vWindowOn: boolean;     {is window area active}
  45.    vWindowIgnore: boolean; {ignore window settings}
  46.    vTempX: byte;
  47.    vTempY: byte;
  48.    {methods...}
  49.    constructor Init;
  50.    procedure   SetScreen(var P:Pointer; W:byte);
  51.    function    WindowOff: boolean;
  52.    procedure   SetWinIgnore(On:Boolean);
  53.    procedure   WindowOn;
  54.    procedure   WindowCoords(var Coords: tByteCoords);
  55.    function    WindowActive: boolean;
  56.    function    WindowInEffect: boolean;
  57.    function    WinX: byte;
  58.    function    WinY: byte;
  59.    procedure   GetWinCoords(var X1,Y1,X2,Y2:byte);
  60.    procedure   GetCursorPos;
  61.    procedure   SetCursorPos;
  62.    procedure   WriteAT(X,Y,attr:byte;Str:string);                     VIRTUAL;
  63.    procedure   WritePlain(X,Y:byte;Str:string);                       VIRTUAL;
  64.    procedure   Write(Str:string);                                     VIRTUAL;
  65.    procedure   WriteLn(Str:string);                                   VIRTUAL;
  66.    procedure   GotoXY(X,Y: word);                                     VIRTUAL;
  67.    function    WhereX: word;                                          VIRTUAL;
  68.    function    WhereY: word;                                          VIRTUAL;
  69.    procedure   SetWindow(X1,Y1,X2,Y2: byte);                          VIRTUAL;
  70.    procedure   ResetWindow;                                           VIRTUAL;
  71.    procedure   ChangeAttr(X,Y,Att:byte;Len:word);                     VIRTUAL;
  72.    procedure   MoveFromScreen(var Source,Dest;Len:Word);              VIRTUAL;
  73.    procedure   MoveToScreen(var Source,Dest; Len:Word);               VIRTUAL;
  74.    procedure   Clear(Att:byte;Ch:char);                               VIRTUAL;
  75.    destructor  Done;                                                  VIRTUAL;
  76. end; {WriteOBJ}
  77.  
  78. ScreenPtr = ^ScreenOBJ;
  79. pScreenOBJ = ^ScreenOBJ;
  80. ScreenOBJ = object
  81.    vWidth: byte;           {how wide is screen}
  82.    vDepth: byte;           {how many lines}
  83.    vScreenPtr: pointer;    {memory location of screen data}
  84.    vCursX: byte;           {cursor location}
  85.    vCursY: byte;           {      -"-      }
  86.    vCursTop: byte;         {cursor size}
  87.    vCursBot: byte;         {    -"-    }
  88.    oWritePtr: WritePtr;    {screen writing and moving object}
  89.    vHiMarker: char;        {character to indicate attribute change}
  90.    vVisible: boolean;      {is the screen mapped to visible display}
  91.    vOnScreen:boolean;
  92.    {methods...}
  93.    constructor Init;
  94.    procedure   SetHiMarker(M:char);
  95.    function    HiMarker:char;
  96.    procedure   AssignWriteOBJ(var Wri: WriteOBJ);
  97.    procedure   SetWindow(X1,Y1,X2,Y2: byte);
  98.    procedure   SetWinIgnore(On:Boolean);
  99.    procedure   ResetWindow;
  100.    function    WindowOff:boolean;
  101.    procedure   WindowOn;
  102.    procedure   WindowCoords(var Coords: tByteCoords);
  103.    function    WindowActive: boolean;
  104.    function    OnScreen:boolean;
  105.    function    CharHeight: integer;
  106.    procedure   CursReset;
  107.    procedure   CursSave; 
  108.    procedure   GotoXY(X,Y: word); 
  109.    procedure   CursSize(T,B: byte);
  110.    function    WhereX: word; 
  111.    function    WhereY: word;
  112.    function    CursTop: byte; 
  113.    function    CursBot: byte; 
  114.    procedure   CursHalf;
  115.    procedure   CursFull;
  116.    procedure   CursOn;
  117.    procedure   CursOff;
  118.    procedure   Exists; 
  119.    procedure   MoveToScreen(var Source, Dest; Length:word); 
  120.    procedure   MoveFromScreen(var Source, Dest; Length:word);
  121.    procedure   Save;
  122.    procedure   Create(X,Y,Attr:byte);
  123.    function    Width: byte; 
  124.    function    Depth: byte;
  125.    function    ScreenPtr: pointer; 
  126.    procedure   Display;
  127.    procedure   PartDisplay(X1,Y1,X2,Y2,X,Y:byte);
  128.    procedure   PartSlideDisplay(X1,Y1,X2,Y2:byte;Way:tDirection);
  129.    procedure   SlideDisplay(Way: tDirection);
  130.    procedure   PartSave (X1,Y1,X2,Y2:byte; VAR Dest);
  131.    procedure   PartRestore (X1,Y1,X2,Y2:byte; VAR Source);
  132.    procedure   CopyScreenBlock(X1,Y1,X2,Y2,X,Y:byte);
  133.    procedure   MoveScreenBlock(X1,Y1,X2,Y2,X,Y:byte);
  134.    procedure   Scroll(Way:tDirection;X1,Y1,X2,Y2:byte);
  135.    procedure   Write(Str:string);
  136.    procedure   WriteLn(Str:string);
  137.    procedure   WriteAT(X,Y,attr:byte;Str:string); 
  138.    procedure   WriteHi(X,Y,AttrHi,Attr:byte;Str:string);
  139.    procedure   WritePlain(X,Y:byte;Str:string); 
  140.    procedure   WriteCap(X,Y,AttrCap,Attr:byte;Str:string);
  141.    procedure   WriteClick(X,Y,attr:byte;Str:string);
  142.    procedure   WriteCenter(Y,Attr:byte;Str:string);
  143.    procedure   WriteBetween(X1,X2,Y,Attr:byte;Str:string);
  144.    procedure   WriteRight(X,Y,Attr:byte;Str:string);
  145.    procedure   WriteVert(X,Y,Attr:byte;Str:string);
  146.    procedure   Attrib(X1,Y1,X2,Y2,Attr:byte); 
  147.    procedure   Clear(Att:byte;Ch:char);
  148.    procedure   PartClear(X1,Y1,X2,Y2,Att:byte;Ch:char);
  149.    procedure   ClearText(X1,Y1,X2,Y2:byte);
  150.    procedure   ReadWord(X,Y:byte;var Attr:byte; var Ch : char); 
  151.    function    ReadChar(X,Y:byte):char;
  152.    function    ReadAttr(X,Y:byte):byte;
  153.    function    ReadStr(X1,X2,Y:byte):string;
  154.    procedure   BoxEngine(X1,Y1,X2,Y2,LeftPad,RightPad,Battr,Tattr,Mattr,style:byte;
  155.                          Filled:boolean;
  156.                          Title:string); 
  157.    procedure   TitleEngine(X1,Y1,X2,Y2,LeftPad,RightPad,Battr,Tattr:byte;Str,Title:string);
  158.    procedure   Box(X1,Y1,X2,Y2,attr,style:byte);
  159.    procedure   FillBox(X1,Y1,X2,Y2,attr,style:byte);
  160.    procedure   ShadFillBox(X1,Y1,X2,Y2,attr,style:byte);
  161.    procedure   TitledBox(X1,Y1,X2,Y2,Battr,Tattr,Mattr,style:byte;Title:string);
  162.    procedure   HorizLine(X1,X2,Y,Attr,Style : byte);
  163.    procedure   VertLine(X,Y1,Y2,Attr,Style:byte);
  164.    procedure   SmartVertLine(X,Y1,Y2,Attr,Style:byte);
  165.    procedure   SmartHorizLine(X1,X2,Y,Attr,Style:byte);
  166.    procedure   WriteHScrollBar(X1,X2,Y,Attr: byte; Current,Max: longint);
  167.    procedure   WriteVScrollBar(X,Y1,Y2,Attr: byte; Current,Max: longint);
  168.    destructor  Done;
  169. end; {ScreenOBJ}
  170.  
  171. pScrollOBJ = ^ScrollOBJ;
  172. ScrollOBJ = object
  173.    vUpArrowChar: char;
  174.    vDownArrowChar: char;
  175.    vLeftArrowChar: char;
  176.    vRightArrowChar: char;
  177.    vElevatorChar: char;
  178.    vBackgroundChar: char;
  179.    {methods...}
  180.    constructor Init;
  181.    procedure   SetDefaults;
  182.    procedure   SetScrollChars(U,D,L,R,E,B:char);
  183.    function    UpChar: char;
  184.    function    DownChar: char;
  185.    function    LeftChar: char;
  186.    function    RightChar: char;
  187.    function    ElevatorChar: char;
  188.    function    BackgroundChar: char;
  189.    destructor  Done;
  190. end; {ScrollOBJ}
  191.  
  192. pShadowOBJ = ^ShadowOBJ;
  193. ShadowOBJ = object
  194.    vShadPos: ShadowPosition;   {where is shadow}
  195.    vShadAttr: byte;            {shadow attribute}
  196.    vShadChar: char;            {shadow character - ' ' is see-through}
  197.    vShadWidth: byte;           {shadow width in characters}
  198.    vShadDepth: byte;           {shad